package com.ease.component.events {
import mx.controls.listClasses.IListItemRenderer;
import mx.events.ListEvent;

/**
 * An event dispatched when a right-click occurs in a list-like control. This class extends
 * ListEvent, but is only defined for ITEM_RIGHT_CLICK which is analogous to
 * ListEvent.CLICK.
 */
public class AdvancedListEvent extends ListEvent {

   /**
    * The event name for a right mouse down. Note the deliberate misnomer, because
    * context menu processing actually happens on the right mouse down but is
    * usually referred to as happenign on a right mouse click.
    */
   public static const ITEM_RIGHT_CLICK:String = "itemRightClick";

   /**
    * The data object corresponding to the list item that was right-clicked.
    */
   public var item:Object;

   /**
    * The global x coordinate where the click occurred
    */
   public var stageX:Number;

   /**
    * The global y coordinate where the click occurred
    */
   public var stageY:Number;

   /**
    * Constructor. The required arguments are the event type and the fields added by
    * this class. The defaults for the remaining arguments match those for the base
    * class, but are not what one would normally use for an item right click event.
    * Item right clicks normally should bubble, should refer to a specific item
    * and hence have row, column, and itemrenderer values.
    */
   public function AdvancedListEvent(
         type:String,
         item:Object,
         stageX:Number,
         stageY:Number,
         bubbles:Boolean=false,
         cancelable:Boolean=false,
         columnIndex:int=-1,
         rowIndex:int=-1,
         reason:String=null,
         itemRenderer:IListItemRenderer=null
      ) {
      super(type, bubbles, cancelable, columnIndex, rowIndex, reason, itemRenderer);
      this.item = item;
      this.stageX = stageX;
      this.stageY = stageY;
   }

}
}
